import requests

URL_IP = 'https://httpbin.org/ip'


def use_simple_request():
    response = requests.get(URL_IP)
    print('>>>>>Response Headers:')
    print(response.headers)
    print('>>>>>Response Body:')
    print(response.text)


def use_params_request():
    params = {'params1': 'hello', 'param2': 'python'}
    response = requests.get(URL_IP, params=params)
    print('>>>>>Response Headers: ')
    print(response.headers)
    print('>>>>>Status Code:')
    print(response.status_code)
    print(response.reason)
    print('>>>>>Response Body:')
    print(response.json())


if __name__ == '__main__':
    '''use_simple_request()'''
    use_params_request()
    print()
